//
//  ZLVideoDecoder.h
//  Video
//
//  Created by os on 2021/3/30.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@class ZLVideoConfig;

// h264 解码回调代理
@protocol ZLVideoDecoderDelegate <NSObject>

// 解码后 h264 数据回调
- (void)videoDecodeCallback:(CVPixelBufferRef)imageBuffer;

@end

/// h264硬解码器（解码和回调均在异步队列执行）
@interface ZLVideoDecoder : NSObject

@property (nonatomic, strong) ZLVideoConfig *config;
@property (nonatomic, weak) id<ZLVideoDecoderDelegate> delegate;

/// 初始化解码器
- (instancetype)initWithConfig:(ZLVideoConfig *)config;

/// 解码h264数据
- (void)decodeNaluData:(NSData *)frame;

@end
